package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaRoomMapper;
import com.ruoyi.tea.domain.TeaRoom;
import com.ruoyi.tea.service.ITeaRoomService;
import com.ruoyi.common.core.text.Convert;

/**
 * 直播间信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaRoomServiceImpl implements ITeaRoomService 
{
    @Autowired
    private TeaRoomMapper teaRoomMapper;

    /**
     * 查询直播间信息
     * 
     * @param id 直播间信息主键
     * @return 直播间信息
     */
    @Override
    public TeaRoom selectTeaRoomById(Long id)
    {
        return teaRoomMapper.selectTeaRoomById(id);
    }

    /**
     * 查询直播间信息列表
     * 
     * @param teaRoom 直播间信息
     * @return 直播间信息
     */
    @Override
    public List<TeaRoom> selectTeaRoomList(TeaRoom teaRoom)
    {
        return teaRoomMapper.selectTeaRoomList(teaRoom);
    }

    /**
     * 查询直播间信息列表
     *
     * @param teaRoom 直播间信息
     * @return 直播间信息
     */
    @Override
    public List<TeaRoom> selectTeaRoomListApi(TeaRoom teaRoom)
    {
        return teaRoomMapper.selectTeaRoomListApi(teaRoom);
    }

    /**
     * 新增直播间信息
     * 
     * @param teaRoom 直播间信息
     * @return 结果
     */
    @Override
    public int insertTeaRoom(TeaRoom teaRoom)
    {
        teaRoom.setCreateTime(DateUtils.getNowDate());
        return teaRoomMapper.insertTeaRoom(teaRoom);
    }

    /**
     * 修改直播间信息
     * 
     * @param teaRoom 直播间信息
     * @return 结果
     */
    @Override
    public int updateTeaRoom(TeaRoom teaRoom)
    {
        return teaRoomMapper.updateTeaRoom(teaRoom);
    }

    /**
     * 批量删除直播间信息
     * 
     * @param ids 需要删除的直播间信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaRoomByIds(String ids)
    {
        return teaRoomMapper.deleteTeaRoomByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除直播间信息信息
     * 
     * @param id 直播间信息主键
     * @return 结果
     */
    @Override
    public int deleteTeaRoomById(Long id)
    {
        return teaRoomMapper.deleteTeaRoomById(id);
    }
}
